package com.cryrabbit.bmbhome.adapters;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by CryRabbit on 2016/7/13.
 */
public class MyPage extends PagerAdapter{
    private List<View> mListviews;
    private List<String> mtitles;
    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(mListviews.get(position));
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(mListviews.get(position));
        return mListviews.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mtitles.get(position);
    }

    public MyPage(List<View> mListviews, List<String> mtitles) {
        this.mListviews = mListviews;
        this.mtitles = mtitles;
    }


}
